"""fp="python3/math/math.1y.txt"

f=open(fp,"r+")
line=f.readline(10000)
print("read:",line)


f=open(fp,"w+")
s=input("输入:")
f.writelines(s)
f.close()

f=open(fp,"w+")
s=str(c_x)
s2=str(c_y)
f.writelines([s+"\n",s2+"\n"])
f.close()
"""
import time
import random
import time
jsk=0
cjq=1
fp="python3/math/math.1y.txt"
time_1=int(time.time())

f=open(fp,"r+")
oldtime=int(f.readline(10000))
timecha=time_1-oldtime
print(f"过去了{timecha}秒")

qian=int(f.readline(10000))
fangqian=int(f.readline(10000))
zhuan=int(f.readline(10000))
zhuan=zhuan/100
zhuan=int(zhuan)
qian=timecha*zhuan+qian
print(f"赚了{timecha*zhuan}块钱，一共{qian}块钱")
xfangqian=int(f.readline(10000))

f=open(fp,"w+")
s=str(time_1)
s1=str(int(qian))
s2=str(int(fangqian))
zhuan=zhuan*100
s3=str(int(zhuan))
s4=str(int(xfangqian))
f.writelines([s+"\n",s1+"\n",s2+"\n",s3+"\n",s4+"\n"])

mimishu=random.randint(1,100)
runing=True
while runing:
    time_1=int(time.time())
    f=open(fp,"r+")
    oldtime=int(f.readline(10000))
    timecha=time_1-oldtime
    qian=int(f.readline(10000))
    fangqian=int(f.readline(10000))
    zhuan=(int(f.readline(10000)))
    zhuan=zhuan/100
    xfangqian=int(f.readline(10000))
    qian=timecha*zhuan+qian
    while jsk>0:
        jsk-=1
        qian+=zhuan*1000
    
    if qian<100000 and cjq<10000:
        cjq*=10000
    """
    if qian>100000 and cjq<10000:
        cjq*10000
        if qian>100000000 and cjq<1000000000:
            cjq*100000
            if qian>10000000000000000:
                cjq*1000000
    """
            
    a=int(input(f"一共{int(qian)}钱，1，买房子，2，赚钱，3，抽奖，4，退出"))
    print()
    if a<1 or a>4:
        pass
    if a==1:
        print(f"原房钱{fangqian}，现房钱{xfangqian}")
        if qian>xfangqian:
            qian-=xfangqian
            fangqian+=fangqian
            xfangqian=fangqian
            zhuan+=zhuan/10
            print(zhuan)
        if qian<xfangqian:
            pass
    if a==2:
        qian+=zhuan/10
    if a==3:
        b=int(input("1，赚钱大抽奖，2，钱大抽奖,3，猜数1"))
        if b<1 or b>2:
            pass
        if b==1:
            c=int(input(f"1,{cjq},94%--0,4%--加速卡,2%--升级卡"))
            if c==1:
                c=int(input("次?"))
                while cjq*c<qian and c>0:
                    qian-=cjq
                    sjk=0
                    jsk=0
                    d=random.randint(1,1000)
                    if d<40:
                        jsk+=1
                    if d>980:
                        zhuan=zhuan*2
                        sjk+=1
                    c-=1
                print("抽到了加速卡",jsk)
                print("抽到了升级卡",sjk)
        if b==2:
            print("1,100块钱，20%--0,40%-50,20%--150,15%--300,4%--1000,1%--5000")
            print("2,1000块钱，40%-500,20%--0,20%--1700,15%--4000,4%--15000,1%--70000")
            print("3，100000块钱，40%-70000,20%--0,20%--150000,15%--300000,4%--1000000,1%--5000000")
            c=int(input("4，退出"))
            if c<1 or c>4:
                pass
            if c==1 and qian>=100:
                qian-=100
                d=random.randint(1,100)
                if d<=20:
                    print("没抽到")
                if d>20 and d<=60:
                    qian+=50
                    print("抽到50")
                if d>60 and d<=80:
                    qian+=150
                    print("抽到150")
                if d>80 and d<=95:
                    q+=300
                    print("抽到300")
                if d==96 or d==97 or d==98 or d==100:
                    q+=1000
                    print("抽到1000")
                if d==99:
                    q+=5000
                    print("抽到5000")
            if c==2 and qian>=1000:
                qian-=1000
                d=random.randint(1,100)
                if d<=20:
                    print("没抽到")
                if d>20 and d<=60:
                    qian+=500
                    print("抽到500")
                if d>60 and d<=80:
                    qian+=1700
                    print("抽到1700")
                if d>80 and d<=95:
                    qian+=4000
                    print("抽到4000")
                if d==96 or d==97 or d==98 or d==100:
                    qian+=15000
                    print("抽到15000")
                if d==99:
                    qian+=70000
                    print("抽到70000")
            if c==3 and qian>=100000:
                qian-=100000
                d=random.randint(1,100)
                if d<=20:
                    print("没抽到")
                if d>20 and d<=60:
                    qian+=70000
                    print("抽到70000")
                if d>60 and d<=80:
                    qian+=150000
                    print("抽到150000")
                if d>80 and d<=95:
                    qian+=300000
                    print("抽到300000")
                if d==96 or d==97 or d==98 or d==100:
                    qian+=1000000
                    print("抽到100000")
                if d==99:
                    qian+=5000000
                    print("抽到5000000")
            if c==4:
                pass
        if b==3:
            c=int(input("?"))
            if c==mimishu:
                qian+=10000
                mimishu=random.randint(1,100)
            if c<mimishu:
                print()
    if a==4:
        runing=False
    if a==5:
        c=int(input("次?"))
        c=c/10
        time.sleep(c)
        qian+=zhuan*c
    if qian > 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:
        print("完成目标，10亿亿亿亿亿亿亿亿亿亿亿亿亿亿亿亿")
        qian=qian/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        zhuan=zhuan/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        fangqian=fangqian/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        xfangqian=xfangqian/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    print(mimishu)
    f=open(fp,"w+")
    s=str(time_1)
    s1=str(int(qian))
    s2=str(int(fangqian))
    zhuan=zhuan*100
    s3=str(int(zhuan))
    s4=str(int(xfangqian))
    f.writelines([s+"\n",s1+"\n",s2+"\n",s3+"\n",s4+"\n"])
    f.close()
f=open(fp,"w+")
s=str(time_1)
s1=str(int(qian))
s2=str(int(fangqian))
s3=str(int(zhuan))
s4=str(int(xfangqian))
f.writelines([s+"\n",s1+"\n",s2+"\n",s3+"\n",s4+"\n"])
f.close()